package com.mallcloud.mall.mall.controller;

import com.mallcloud.mall.common.core.util.R;
import com.mallcloud.mall.mall.api.entity.MallUserPointsBalanceModel;
import com.mallcloud.mall.mall.service.MallUserPointsBalanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "mall-用户积分余额")
@RestController
@RequiredArgsConstructor
@RequestMapping("/mall/userPointsBalance")
public class MallUserPointsBalanceController {
	private final MallUserPointsBalanceService userPointsBalanceService;

	@ApiOperation("查询详情")
	@GetMapping("/getInfo")
	@PreAuthorize("@pms.hasPermission('mall_userpointsbalance_view')")
	public R<MallUserPointsBalanceModel> getInfo(String cardNo) {
		return R.ok(userPointsBalanceService.getInfo(cardNo));
	}
}
